﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using DotSpatial.Data;

using DotSpatial.Symbology;


namespace HaGisPack
{
    public partial class frmSingleFeatureSelect : Form
    {
        //public frmSingleFeatureSelect(Dictionary <string,List<Feature >> layerFeatures)
        //{
        //    InitializeComponent();
            
        //}

        /// <summary>
        /// 先写一个重载的吧，
        /// </summary>
        /// <param name="layers"></param>
        public frmSingleFeatureSelect(List<Feature> features)
        {
            InitializeComponent();
            this._features = features;
        }


        List<Feature> _features; //所有选择的图形


        Feature _SelectedFeature;

        /// <summary>
        /// 选中的feature
        /// </summary>
        public Feature SelectedFeature
        {
            get { return _SelectedFeature; }
            set { this._SelectedFeature = value; }
        }

        private void frmSingleFeatureSelect_Load(object sender, EventArgs e)
        {
            foreach (Feature f in this._features)
            {
                this.listfeatrues.Items.Add(f.DataRow["id"]);
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this._SelectedFeature = this._features[this.listfeatrues.SelectedIndex];

            this.DialogResult = DialogResult.OK;
        }



    }
}
